#include "widget.h"
#include "ui_widget.h"
#include<QDebug>
Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
//    ui->comboBox->;
    ui->comboBox->addItem("语文");
    ui->comboBox->addItem("数学");
    ui->comboBox->addItem("英语");

    ui->comboBox_2->addItem("物理");
    ui->comboBox_2->addItem("历史");

    ui->comboBox_3->addItem("地理");
    ui->comboBox_3->addItem("政治");
    ui->comboBox_3->addItem("生物");
    ui->comboBox_3->addItem("化学");




}

Widget::~Widget()
{
    delete ui;
}


void Widget::on_comboBox_currentIndexChanged(const QString &arg1)
{
    QString s=arg1;
//    qDebug()<<ui->comboBox_2->currentText();

    s+=ui->comboBox_2->currentText();
    s+=ui->comboBox_3->currentText();
    ui->label_4->setText(s);

}

void Widget::on_comboBox_2_currentIndexChanged(const QString &arg1)
{
    QString s2=arg1;
//    qDebug()<<ui->comboBox->currentText();

    QString s1=ui->comboBox->currentText();
    QString s3=ui->comboBox_3->currentText();
    ui->label_4->setText(s1+s2+s3);

}

void Widget::on_comboBox_3_currentIndexChanged(const QString &arg1)
{

    QString s3=arg1;
//    qDebug()<<ui->comboBox->currentText();

    QString s1=ui->comboBox->currentText();
    QString s2=ui->comboBox_2->currentText();
    ui->label_4->setText(s1+s2+s3);

}

void Widget::on_pushButton_clicked()
{
    qDebug()<<"主科目"<<ui->comboBox->currentText();
    qDebug()<<"两大科目"<<ui->comboBox_2->currentText();
    qDebug()<<"副科目"<<ui->comboBox_3->currentText();

}
